pp108 : toTimezone Method (DateFormat)

toTimezone Method (DateFormat)


Converts the JavaScript Date object to the target time zone.

Syntax

dateFormatObj.toTimezone(dObject, timezone)

Parameters

Parameter

Description

dObject

Required. The JavaScript Date object.

timezone

Required. The time zone name.


Return Value


JavaScript Date object according to the target time zone.

Example


The following example shows how this method is used.

importType("wcp.library.util.LocaleFormat");

importType("wcp.library.util.DateFormat");

var dateFormat = new DateFormat(sFormat, localeName, elmt);
dateFormat.toTimezone(new Date(), "Africa/Abidjan");

See Also


DateFormat, Locale, Timezone